function init_grid () {
    $("#bonus-list").flexigrid({
        url: _webroot+'/sales/bonus_list',
        dataType: 'json',
        colModel: [
            { display: 'Week', name: 'WeeklyBonusID', width: 56, sortable: true, align: 'right' },
            { display: 'Start Date', name: 'BonusDate', width: 52, sortable: true, align: 'left' },
            { display: 'End Date', name: 'BonusDate', width: 80, sortable: true, align: 'left' },
            { display: 'Pay Date', name: 'BonusDate', width: 52, sortable: true, align: 'left', hide:true },
            { display: 'Sponsor Bonus', name: 'GBV', width: 75, sortable: true, align: 'left' },
            { display: 'Overcommit Bonus', name: 'UPBV', width: 90, sortable: true, align: 'left' },
            { display: 'Counselor bonus', name: 'PBV', width: 80, sortable: true, align: 'left' },
            { display: 'Cycle Payout(Cycles)', name: 'cyclecount', width: 58, sortable: true, align: 'left' },
            { display: 'Global leader bonus', name: 'GlobalBns', width: 95, sortable: true, align: 'left' },
            { display: 'Product Coupon', name: 'Coupons', width: 76, sortable: true, align: 'left' },
            { display: 'Total Before Tax', name: 'PBVDist', width: 80, sortable: true, align: 'left' },
            { display: 'Details', name: 'actions', width: 30, align: 'center' }
        ],
        searchitems: [
            { display: 'Week', name: 'WeeklyBonusID', isdefault: true },
            { display: 'Start Date', name: 'BonusDate' },
            { display: 'Pay Date', name: 'BonusDate' }
        ],
        sortname: 'WeeklyBonusID',
        sortorder: 'asc',
        usepager: true,
        title: 'Bonus List',
        useRp: true,
        rp: 15,
        showTableToggleBtn: false,
        width: 906, //970,
        height: 300
    });
} // init_grid

function reload_grid () {
    $("#bonus-list").flexReload();
} // reload_grid

function message (msg, focus) {
    alert(msg);

    if (typeof focus != 'undefined') {
        Ext.fly(focus).focus();
    }
} // message

function init () {
    init_grid();
} // init